class ParameterNorm < ActiveRecord::Base

  hobo_model # Don't put anything above this

  fields do
    name :string
    norm :decimal
    timestamps
  end

    has_and_belongs_to_many  :examination_types


  # --- Validation --- #
  validates_presence_of :name, :norm
  validates_numericality_of :norm


  # --- Permissions --- #

  def create_permitted?
    acting_user.administrator?
  end

  def update_permitted?
    acting_user.administrator?
  end

  def destroy_permitted?
    acting_user.administrator?
  end

  def view_permitted?(field)
    true
  end

end
